With the continuous development of Web technology, widgets have been increasingly widely used in Web application. The term “widget” as used here refers to an independent small application that can be embedded into a third party Web interface by a user or a process in case of authorization. The “Web interface” as used here includes but is not limited to the Web page or any user interface of Web-based application.
Widgets allow users to add personalized and/or customizable dynamic contents to a Web page or a Web application. As an example, a user can add widget “weather forecast” related to weather information to the Web interface so as to access from a corresponding weather information provider the data related to the weather condition and dynamically display the data on the Web interface. A widget is usually implemented by Web technology such as JavaScript, Flash, HTML, CSS, etc., and can perform various operations based on API provided by a Web browser or a widget container. Generally speaking, a widget includes components such as a definition file and resource files. The definition file of the widget is, for example, an Extensible Markup Language (XML) document, which describes the attribute, event and view, etc. of the widget. The resource files, for example, can include a JS document, a Cascading Style Sheet (CSS) document, etc.
On a Web interface, widgets are generally managed by “container.” The “container” provides functionality for rendering and managing widgets and associated classes e.g. JavaScript class. For example, a widget container can manage a set of widgets in a Web interface, parse the definition of each widget and create a corresponding encapsulation to render the widget in the Web interface. The widget container can also manage the lifecycle of the widget and process shared objects. Considering a Web browser application as an example, each Web page displayed by the Web browser application can be associated with a widget container, and the widget container is used to manage and control the widgets residing in the page displayed by the instance or tag. In this document, the management and control of widgets by the widget container can be referred as “hosting.”
In operation, the user usually wants to move the rendered widgets within the user interface at runtime. The term “runtime” used herein refers to the state in which widgets have been put into use after being developed, e.g. after having been deployed and rendered. For example, a common means for implementing such a movement of widgets at runtime is a Drag-and-Drop (DnD) operation. The user, for example, can use a pointing device like a mouse to select a widget to be moved e.g. by pressing the left key of the mouse. Then the user can use the pointing device to drag the selected widget e.g. by transferring the cursor of the mouse while keeping the left key of the mouse pressed, until a target position is reached. In response to an indication of a drag-and-drop completion e.g. by releasing the left key of the mouse, the widget is moved to the target position.
However, currently, the movement or transfer of a widget at runtime only can be executed in the same container, and cannot be executed across containers. Still considering the Web browser application as an example, as described above, one instance or tag of Web browser application is generally associated with one widget container. In the prior art, it is impossible for a user to transfer a deployed and rendered widget in one instance of the Web browser application to another instance.
It can be understood that the developer of the widget can deploy a widget in different containers during the development by, for example, copying widget codes between different containers and applications. However, such a manner is not adapted to the end user because the end user cannot obtain the source code of a widget. In other words, in the prior art, the transfer of a widget between different container only can be implemented by the developer during the period of development and/or maintenance, while the end user cannot transfer a widget between different containers in an interactive manner at runtime.
The above problem brings inconvenience to the use and operation of the user. For example, the user can add a “weather forecast” widget to the page displayed by a Web browser instance, and conduct a specific personalized setting. In this case, if the user hopes to use the same widget in the page displayed by another Web browser instance, the user must perform the entire adding and setting process again and cannot reuse the deployed and set widget by transferring it.